<template>
	<el-table-column label="修改记录" width="100" align="center" show-overflow-tooltip>
		<template #default="scope">
			<el-popover placement="bottom" width="280" trigger="hover">
				<template #reference>
					<el-text type="primary" class="cursor-default">
						<el-icon><ele-InfoFilled /></el-icon>详情
					</el-text>
				</template>
				<el-descriptions direction="vertical" :column="2" border>
					<el-descriptions-item width="140">
						<template #label>
							<el-text>
								<el-icon><ele-UserFilled /></el-icon>创建者
							</el-text>
						</template>
						<el-tag>{{ scope.row.createUserName ?? '无' }}</el-tag>
					</el-descriptions-item>
					<el-descriptions-item>
						<template #label>
							<el-text>
								<el-icon><ele-Calendar /></el-icon>创建时间
							</el-text>
						</template>
						<el-tag>{{ scope.row.createTime ?? '无' }}</el-tag>
					</el-descriptions-item>
					<el-descriptions-item>
						<template #label>
							<el-text>
								<el-icon><ele-UserFilled /></el-icon>修改者
							</el-text>
						</template>
						<el-tag>{{ scope.row.updateUserName ?? '无' }}</el-tag>
					</el-descriptions-item>
					<el-descriptions-item>
						<template #label>
							<el-text>
								<el-icon><ele-Calendar /></el-icon>修改时间
							</el-text>
						</template>
						<el-tag>{{ scope.row.updateTime ?? '无' }}</el-tag>
					</el-descriptions-item>
					<el-descriptions-item v-if="scope.row.remark">
						<template #label>
							<el-text>
								<el-icon><ele-Tickets /></el-icon>备注
							</el-text>
						</template>
						{{ scope.row.remark ?? '无' }}
					</el-descriptions-item>
				</el-descriptions>
			</el-popover>
		</template>
	</el-table-column>
</template>

<script lang="ts" setup>
// 统一的修改记录列
defineOptions({
	name: 'MkColumnModifyRecord'
})
</script>
